<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
    
        .red{
            background-color: #ff0000;
        }
        
        .green{
            background-color: #00ff00;
        }
    </style>
</head>

<body>
    <div id="app">

        <div class="red"></div>

        <div v-bind:class="color">123   </div>
        <!-- <div class='red'></div> -->

        <p v-for="i in 10"  v-bind:class="{red: i % 2 == 0, green: i % 2 != 0}">床前第1个明月光</p>


    </div>
    <script src="./node_modules/vue/dist/vue.js"></script>
    <script>
        var vm = new Vue({
            el: "#app",
            data: {
                color: "red"
            }
        })
    </script>
</body>

</html>